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

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: C = None
        self.txt = txt

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

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

c = A("c")
i = B("i")
f = C("f")
h = D("h")
b = E("b")
g = F("g")
l = F("l")

c.o = f
c.s = b
i.t = g
f.x = i
f.s = h
f.u = b
h.w = g
h.u = f
b.q = c
b.w = c
b.v = f
g.z = i
g.w = b
g.u = h
l.z = i
l.w = b
l.u = h
assert i.t.z.t.u.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: C = None
        self.txt = txt

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

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

c = A("c")
i = B("i")
f = C("f")
h = D("h")
b = E("b")
g = F("g")
l = F("l")

c.o = f
c.s = b
i.t = g
f.x = i
f.s = h
f.u = b
h.w = g
h.u = f
b.q = c
b.w = c
b.v = f
g.z = i
g.w = b
g.u = h
l.z = i
l.w = b
l.u = h
assert i.t.z.t.u.u.s.txt == "h"