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

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

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

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

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

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

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

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

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

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

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

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

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

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

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