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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

n.t = a
n.z = j
a.y = l
a.r = n
a.x = n
a.t = m
c.x = l
c.r = j
l.r = c
l.v = n
m.x = l
j.u = c
assert a.x.t.y.txt == "l"