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

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

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

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

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

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

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

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

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

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

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

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

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

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

f.r = j
f.w = n
f.u = g
m.z = j
j.p = d
c.v = l
c.t = l
c.s = h
c.p = j
h.x = m
h.t = n
n.s = h
n.x = e
g.v = l
g.t = l
g.s = h
g.p = j
l.r = j
l.w = n
l.u = g
d.x = e
d.t = n
e.z = j
assert j.p.t.s.txt == "h"