class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: A = None
        self.y: D = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: A = None
        self.y: D = None
        self.w: A = None
        self.txt = txt

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

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

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