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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: B = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: A = None
        self.x: F = None
        self.p: F = None
        self.o: E = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: F = None
        self.r: B = None
        self.u: F = None
        self.t: A = None
        self.txt = txt

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

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

n.p = h
n.q = h
n.y = l
n.t = c
j.s = a
m.w = a
m.r = a
m.s = j
h.w = a
h.x = a
h.p = a
h.y = c
h.o = f
h.q = m
f.x = h
f.y = a
f.u = a
f.r = j
f.t = n
a.x = c
l.x = h
l.y = a
l.u = a
l.r = j
l.t = c
c.p = h
c.q = h
c.y = f
c.t = n
assert h.y.t.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: E = None
        self.q: D = None
        self.t: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: B = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: A = None
        self.x: F = None
        self.p: F = None
        self.o: E = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: F = None
        self.r: B = None
        self.u: F = None
        self.t: A = None
        self.txt = txt

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

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

n.p = h
n.q = h
n.y = l
n.t = c
j.s = a
m.w = a
m.r = a
m.s = j
h.w = a
h.x = a
h.p = a
h.y = c
h.o = f
h.q = m
f.x = h
f.y = a
f.u = a
f.r = j
f.t = n
a.x = c
l.x = h
l.y = a
l.u = a
l.r = j
l.t = c
c.p = h
c.q = h
c.y = f
c.t = n
assert h.y.t.q.q.txt == "m"