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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: D = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: D = None
        self.s: D = None
        self.txt = txt

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

j.t = b
j.r = b
j.w = h
l.r = h
l.t = a
b.x = h
b.t = h
b.z = l
b.q = a
b.y = a
a.y = g
a.z = h
a.q = h
g.u = a
h.v = g
h.r = a
h.s = a
assert l.t.z.v.u.y.u.txt == "a"