class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

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

h.r = l
h.p = g
l.t = a
l.q = n
b.u = n
b.z = n
b.r = g
b.w = i
b.y = h
n.z = m
n.u = g
n.x = a
i.y = a
g.u = l
g.x = n
g.o = n
m.u = n
m.z = n
m.r = g
m.w = i
m.y = a
a.r = l
a.p = g
assert n.x.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

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

h.r = l
h.p = g
l.t = a
l.q = n
b.u = n
b.z = n
b.r = g
b.w = i
b.y = h
n.z = m
n.u = g
n.x = a
i.y = a
g.u = l
g.x = n
g.o = n
m.u = n
m.z = n
m.r = g
m.w = i
m.y = a
a.r = l
a.p = g
assert n.x.r.t.txt == "a"