class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: A = None
        self.q: E = None
        self.u: E = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: C = None
        self.s: E = None
        self.x: A = None
        self.o: C = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: D = None
        self.o: D = None
        self.u: A = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: F = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: C = None
        self.s: E = None
        self.x: A = None
        self.o: C = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: D = None
        self.o: D = None
        self.u: A = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: F = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: A = None
        self.txt = txt

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

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