class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: B = None
        self.y: A = None
        self.r: A = None
        self.x: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: E = None
        self.z: A = None
        self.o: D = None
        self.w: E = None
        self.p: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: D = None
        self.w: A = None
        self.v: F = None
        self.p: B = None
        self.r: B = None
        self.txt = txt

i = A("i")
k = B("k")
m = C("m")
a = D("a")
l = E("l")
b = F("b")
c = G("c")
d = A("d")
h = C("h")

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: E = None
        self.z: A = None
        self.o: D = None
        self.w: E = None
        self.p: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: D = None
        self.w: A = None
        self.v: F = None
        self.p: B = None
        self.r: B = None
        self.txt = txt

i = A("i")
k = B("k")
m = C("m")
a = D("a")
l = E("l")
b = F("b")
c = G("c")
d = A("d")
h = C("h")

i.u = a
i.w = k
i.y = d
i.r = d
i.x = d
k.q = a
k.o = a
k.r = l
k.w = l
k.z = i
k.p = d
m.v = a
a.v = k
l.w = i
l.o = a
b.v = i
b.z = k
b.t = a
c.z = a
c.u = a
c.w = i
c.v = b
c.p = k
c.r = k
d.u = a
d.w = k
d.y = i
d.r = i
d.x = i
h.v = a
assert i.w.z.w.z.x.r.txt == "i"