class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: E = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

b = A("b")
e = B("e")
g = C("g")
i = D("i")
k = E("k")
f = F("f")
n = C("n")
h = F("h")
l = B("l")
m = E("m")

b.u = k
b.z = m
b.o = g
e.v = i
g.t = k
g.x = h
i.w = b
k.w = b
f.u = b
n.t = k
n.x = f
h.u = b
l.v = i
m.w = b
assert g.t.w.u.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: E = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

b = A("b")
e = B("e")
g = C("g")
i = D("i")
k = E("k")
f = F("f")
n = C("n")
h = F("h")
l = B("l")
m = E("m")

b.u = k
b.z = m
b.o = g
e.v = i
g.t = k
g.x = h
i.w = b
k.w = b
f.u = b
n.t = k
n.x = f
h.u = b
l.v = i
m.w = b
assert g.t.w.u.w.u.txt == "k"