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

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

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

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

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

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

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

g.t = i
b.w = i
b.z = e
b.y = n
b.u = h
n.y = h
n.z = i
m.s = g
i.v = m
e.t = m
e.z = h
h.w = i
h.z = e
h.y = n
h.u = b
assert n.y.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

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

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

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

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

g.t = i
b.w = i
b.z = e
b.y = n
b.u = h
n.y = h
n.z = i
m.s = g
i.v = m
e.t = m
e.z = h
h.w = i
h.z = e
h.y = n
h.u = b
assert n.y.u.y.txt == "n"