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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: C = None
        self.r: D = None
        self.s: C = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

l = A("l")
c = B("c")
g = C("g")
m = D("m")
d = E("d")
j = F("j")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: C = None
        self.r: D = None
        self.s: C = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

l = A("l")
c = B("c")
g = C("g")
m = D("m")
d = E("d")
j = F("j")

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