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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: B = None
        self.x: B = None
        self.y: F = None
        self.r: F = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: C = None
        self.u: B = None
        self.t: C = None
        self.z: B = None
        self.txt = txt

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

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

m = A("m")
g = B("g")
j = C("j")
l = D("l")
h = E("h")
n = F("n")
c = A("c")
a = B("a")

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: B = None
        self.x: B = None
        self.y: F = None
        self.r: F = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: C = None
        self.u: B = None
        self.t: C = None
        self.z: B = None
        self.txt = txt

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

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

m = A("m")
g = B("g")
j = C("j")
l = D("l")
h = E("h")
n = F("n")
c = A("c")
a = B("a")

m.r = j
m.w = j
m.z = n
g.v = a
g.t = n
j.u = a
j.p = g
j.x = g
j.y = n
j.r = n
j.s = m
l.s = j
l.r = j
l.t = j
l.u = g
l.z = g
h.t = j
h.z = n
n.p = j
n.y = c
c.r = j
c.w = j
c.z = n
a.v = g
a.t = n
assert a.v.t.y.txt == "c"