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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

c = A("c")
l = B("l")
f = C("f")
d = D("d")
b = E("b")
m = F("m")
n = A("n")
k = E("k")
j = B("j")

c.x = b
l.t = f
l.r = b
l.q = b
l.o = m
l.z = m
l.x = k
f.y = m
d.y = c
b.v = d
b.w = f
m.t = d
m.y = l
n.x = b
k.v = d
k.w = f
j.t = f
j.r = k
j.q = k
j.x = k
j.o = m
j.z = m
assert d.y.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

c = A("c")
l = B("l")
f = C("f")
d = D("d")
b = E("b")
m = F("m")
n = A("n")
k = E("k")
j = B("j")

c.x = b
l.t = f
l.r = b
l.q = b
l.o = m
l.z = m
l.x = k
f.y = m
d.y = c
b.v = d
b.w = f
m.t = d
m.y = l
n.x = b
k.v = d
k.w = f
j.t = f
j.r = k
j.q = k
j.x = k
j.o = m
j.z = m
assert d.y.x.v.txt == "d"