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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: C = None
        self.y: C = None
        self.u: A = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: F = None
        self.z: E = None
        self.v: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: B = None
        self.y: B = None
        self.s: E = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

g = A("g")
h = B("h")
l = C("l")
f = D("f")
d = E("d")
k = F("k")
b = E("b")

g.t = h
g.s = k
h.w = f
h.z = f
h.q = l
h.y = l
h.u = g
l.r = k
l.y = k
l.z = b
l.v = g
f.p = g
f.u = g
f.z = k
f.o = k
f.w = b
f.r = h
d.x = h
d.p = h
d.y = h
d.s = b
d.u = l
k.z = l
b.x = h
b.p = h
b.y = h
b.s = d
b.u = l
assert g.t.q.z.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: C = None
        self.y: C = None
        self.u: A = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: F = None
        self.z: E = None
        self.v: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: B = None
        self.y: B = None
        self.s: E = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

g = A("g")
h = B("h")
l = C("l")
f = D("f")
d = E("d")
k = F("k")
b = E("b")

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