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

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

h.t = c
h.x = c
c.y = b
c.p = b
c.t = b
c.x = i
i.z = c
i.v = b
g.q = b
a.y = i
b.t = c
b.x = c
b.u = l
l.t = c
l.x = c
assert l.x.t.t.p.t.x.v.txt == "b"