class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: D = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: D = None
        self.p: G = None
        self.u: A = None
        self.w: B = None
        self.y: B = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: C = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: C = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: D = None
        self.txt = txt

l = A("l")
b = B("b")
n = C("n")
d = D("d")
e = E("e")
h = F("h")
a = G("a")
c = G("c")

l.z = d
b.s = d
b.r = d
b.p = d
n.q = h
n.o = d
n.v = d
n.p = c
n.u = l
n.w = b
n.y = b
d.u = l
e.r = d
e.w = n
e.v = l
h.x = c
h.t = n
h.q = a
a.w = l
a.q = d
c.w = l
c.q = d
assert e.r.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: D = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: D = None
        self.p: G = None
        self.u: A = None
        self.w: B = None
        self.y: B = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: C = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: C = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: D = None
        self.txt = txt

l = A("l")
b = B("b")
n = C("n")
d = D("d")
e = E("e")
h = F("h")
a = G("a")
c = G("c")

l.z = d
b.s = d
b.r = d
b.p = d
n.q = h
n.o = d
n.v = d
n.p = c
n.u = l
n.w = b
n.y = b
d.u = l
e.r = d
e.w = n
e.v = l
h.x = c
h.t = n
h.q = a
a.w = l
a.q = d
c.w = l
c.q = d
assert e.r.u.z.txt == "d"