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

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

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

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

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

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

b = A("b")
c = B("c")
g = C("g")
h = D("h")
d = E("d")
j = F("j")
l = A("l")

b.u = h
b.q = h
b.o = g
b.z = l
b.y = l
c.r = d
c.u = g
c.w = g
c.v = g
c.q = g
g.o = j
g.u = h
h.s = g
d.v = g
d.q = b
j.u = h
j.z = h
j.r = l
j.q = g
l.u = h
l.q = h
l.o = g
l.z = b
l.y = b
assert h.s.u.s.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: C = None
        self.z: A = None
        self.y: A = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

b = A("b")
c = B("c")
g = C("g")
h = D("h")
d = E("d")
j = F("j")
l = A("l")

b.u = h
b.q = h
b.o = g
b.z = l
b.y = l
c.r = d
c.u = g
c.w = g
c.v = g
c.q = g
g.o = j
g.u = h
h.s = g
d.v = g
d.q = b
j.u = h
j.z = h
j.r = l
j.q = g
l.u = h
l.q = h
l.o = g
l.z = b
l.y = b
assert h.s.u.s.u.s.txt == "g"