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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: D = None
        self.w: A = None
        self.p: D = None
        self.u: E = None
        self.t: E = None
        self.txt = txt

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

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

l = A("l")
a = B("a")
c = C("c")
g = D("g")
n = E("n")
k = F("k")
e = D("e")
f = D("f")
d = A("d")
h = B("h")

l.w = d
l.z = c
l.y = k
a.u = n
c.x = k
c.u = e
g.y = f
g.p = f
g.s = e
g.w = d
g.u = n
g.t = n
n.p = e
n.s = g
k.u = n
e.y = f
e.s = f
e.p = f
e.w = l
e.u = n
e.t = n
f.y = e
f.p = e
f.s = g
f.w = l
f.u = n
f.t = n
d.w = l
d.z = c
d.y = k
h.u = n
assert g.p.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: C = None
        self.y: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: D = None
        self.w: A = None
        self.p: D = None
        self.u: E = None
        self.t: E = None
        self.txt = txt

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

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

l = A("l")
a = B("a")
c = C("c")
g = D("g")
n = E("n")
k = F("k")
e = D("e")
f = D("f")
d = A("d")
h = B("h")

l.w = d
l.z = c
l.y = k
a.u = n
c.x = k
c.u = e
g.y = f
g.p = f
g.s = e
g.w = d
g.u = n
g.t = n
n.p = e
n.s = g
k.u = n
e.y = f
e.s = f
e.p = f
e.w = l
e.u = n
e.t = n
f.y = e
f.p = e
f.s = g
f.w = l
f.u = n
f.t = n
d.w = l
d.z = c
d.y = k
h.u = n
assert g.p.y.t.txt == "n"